.class public Lcom/burstly/lib/currency/BalanceUpdateInfo;
.super Ljava/lang/Object;
.source "BalanceUpdateInfo.java"


# instance fields
.field private mChange:I

.field private final mCurrency:Ljava/lang/String;

.field private mNewTotal:I

.field private mOldTotal:I


# direct methods
.method private constructor <init>(Ljava/lang/String;III)V
    .locals 0
    .parameter "currency"
    .parameter "oldTotal"
    .parameter "newTotal"
    .parameter "change"

    .prologue
    .line 42
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 43
    iput-object p1, p0, Lcom/burstly/lib/currency/BalanceUpdateInfo;->mCurrency:Ljava/lang/String;

    .line 44
    iput p2, p0, Lcom/burstly/lib/currency/BalanceUpdateInfo;->mOldTotal:I

    .line 45
    iput p3, p0, Lcom/burstly/lib/currency/BalanceUpdateInfo;->mNewTotal:I

    .line 46
    iput p4, p0, Lcom/burstly/lib/currency/BalanceUpdateInfo;->mChange:I

    .line 47
    return-void
.end method

.method public static createFrom(Lcom/burstly/lib/currency/UserCurrencyAccount;)Lcom/burstly/lib/currency/BalanceUpdateInfo;
    .locals 5
    .parameter "account"

    .prologue
    .line 119
    invoke-virtual {p0}, Lcom/burstly/lib/currency/UserCurrencyAccount;->getActualBalance()I

    move-result v0

    .line 120
    .local v0, actualBalance:I
    invoke-virtual {p0}, Lcom/burstly/lib/currency/UserCurrencyAccount;->getOldTotalCurrencyAmount()I

    move-result v1

    .line 121
    .local v1, oldBalance:I
    new-instance v2, Lcom/burstly/lib/currency/BalanceUpdateInfo;

    invoke-virtual {p0}, Lcom/burstly/lib/currency/UserCurrencyAccount;->getCurrency()Ljava/lang/String;

    move-result-object v3

    sub-int v4, v0, v1

    invoke-direct {v2, v3, v1, v0, v4}, Lcom/burstly/lib/currency/BalanceUpdateInfo;-><init>(Ljava/lang/String;III)V

    return-object v2
.end method

.method public static createFrom(Ljava/util/Map;)Ljava/util/Map;
    .locals 5
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Lcom/burstly/lib/currency/UserCurrencyAccount;",
            ">;)",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Lcom/burstly/lib/currency/BalanceUpdateInfo;",
            ">;"
        }
    .end annotation

    .prologue
    .line 131
    .local p0, accounts:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Lcom/burstly/lib/currency/UserCurrencyAccount;>;"
    new-instance v2, Ljava/util/HashMap;

    invoke-direct {v2}, Ljava/util/HashMap;-><init>()V

    .line 132
    .local v2, result:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Lcom/burstly/lib/currency/BalanceUpdateInfo;>;"
    invoke-interface {p0}, Ljava/util/Map;->entrySet()Ljava/util/Set;

    move-result-object v3

    invoke-interface {v3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_0

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map$Entry;

    .line 133
    .local v0, entry:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<Ljava/lang/String;Lcom/burstly/lib/currency/UserCurrencyAccount;>;"
    invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v4

    invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/burstly/lib/currency/UserCurrencyAccount;

    invoke-static {v3}, Lcom/burstly/lib/currency/BalanceUpdateInfo;->createFrom(Lcom/burstly/lib/currency/UserCurrencyAccount;)Lcom/burstly/lib/currency/BalanceUpdateInfo;

    move-result-object v3

    invoke-interface {v2, v4, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_0

    .line 135
    .end local v0           #entry:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<Ljava/lang/String;Lcom/burstly/lib/currency/UserCurrencyAccount;>;"
    :cond_0
    return-object v2
.end method


# virtual methods
.method public getChange()I
    .locals 1

    .prologue
    .line 82
    iget v0, p0, Lcom/burstly/lib/currency/BalanceUpdateInfo;->mChange:I

    return v0
.end method

.method public getCurrency()Ljava/lang/String;
    .locals 1

    .prologue
    .line 55
    iget-object v0, p0, Lcom/burstly/lib/currency/BalanceUpdateInfo;->mCurrency:Ljava/lang/String;

    return-object v0
.end method

.method public getNewTotal()I
    .locals 1

    .prologue
    .line 73
    iget v0, p0, Lcom/burstly/lib/currency/BalanceUpdateInfo;->mNewTotal:I

    return v0
.end method

.method public getOldTotal()I
    .locals 1

    .prologue
    .line 64
    iget v0, p0, Lcom/burstly/lib/currency/BalanceUpdateInfo;->mOldTotal:I

    return v0
.end method

.method setChange(I)V
    .locals 0
    .parameter "change"

    .prologue
    .line 109
    iput p1, p0, Lcom/burstly/lib/currency/BalanceUpdateInfo;->mChange:I

    .line 110
    return-void
.end method

.method setNewTotal(I)V
    .locals 0
    .parameter "newTotal"

    .prologue
    .line 100
    iput p1, p0, Lcom/burstly/lib/currency/BalanceUpdateInfo;->mNewTotal:I

    .line 101
    return-void
.end method

.method setOldTotal(I)V
    .locals 0
    .parameter "oldTotal"

    .prologue
    .line 91
    iput p1, p0, Lcom/burstly/lib/currency/BalanceUpdateInfo;->mOldTotal:I

    .line 92
    return-void
.end method
